home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HPAVC
/
HPAVC CD-ROM.iso
/
GSAVE2.ZIP
/
C_PLUS.ZIP
/
GLOAD2.C
< prev
next >
Wrap
C/C++ Source or Header
|
1995-12-22
|
1KB
|
68 lines
//Wow, my first C++ program! by Earwax!
//Its so slow cause i think its reading eery pixel seperately, also cause
//i couldn't figure out how to get "malloc" working properly etc.
#include <stdio.h>
#include <stdlib.h>
void load_gs_file(void)
{
FILE *gs_file;
unsigned char palette[768], pixel;
if ((gs_file = fopen("\SCREENGS.000", "rb")) == NULL)
{
asm mov ax,0003h
asm int 10h
printf("Error opening SCREENGS.000!\n");
exit(0);
}
fread(palette,1,768,gs_file);
asm {
mov dx,3c8h
xor al,al
out dx,al
inc dx
mov cx,768
lea si,palette
}
load_colors:
asm lodsb
asm out dx,al
asm loop load_colors
asm mov cx,64000
asm xor di,di
asm mov ax,0a000h
asm mov es,ax
load_picture_loop:
asm push cx
pixel = fgetc(gs_file);
asm pop cx
_AL=pixel;
asm stosb
asm loop load_picture_loop
fclose(gs_file);
}
int main()
{
asm mov ax,0013h
asm int 10h
load_gs_file();
asm xor ah,ah
asm int 16h
asm mov ax,0003h
asm int 10h
printf("Stoopid C loading routines for SCREENGS.??? files\n");
printf("(S)toopidright Earwax!\n");
return(0);
}